<div class="wrap">
<h2>Step 2</h2>
<?php
function makePin($lenth =5) { 
    // makes a random alpha numeric string of a given lenth 
    $aZ09 = array_merge(range('A', 'Z'), range('a', 'z'),range(0, 9)); 
    $out =''; 
    for($c=0;$c < $lenth;$c++) { 
       $out .= $aZ09[mt_rand(0,count($aZ09)-1)]; 
    } 
    return $out; 
} 
?>
<script>
	$("button[name=cancelStep2]").click(function() {
		$("#step2").hide();
	});
	$("input[name=submitStep2]").click(function() {
		$("button[name=cancelStep2]").fadeOut();
		<?php
			$dbName = $_POST['DBname']; $DBuser = $_POST['DBuser']; $host = $_POST['host']; $DBpass = $_POST['DBpass'];
			echo 'var name = $("input[name=name]").val(); var username = $("input[name=username]").val(); var password = $("input[name=password]").val();';
			echo '$("#step3").load("step3.php", {name: name, username: username, password: password, dbName: "'.$dbName.'", dbUser: "'.$DBuser.'", dbPass: "'.$DBpass.'"});';
		?>
	});
</script>
<p>Service Information. Here you can choose things such as username and password, and service name</p>
<table>
<tr><td>Name</td><td><input type="text" name="name" value="3txt" /></td></tr>
<tr><td>Username</td><td><input type="text" name="username" value="admin" /></td></tr>
<tr><td>Password</td><td><input type="text" name="password" value="<?php echo makePin(); ?>" /></td></tr>
<tr><td><button name="cancelStep2">Cancel</button></td><td><input type="submit" name="submitStep2" value="Go!" /></td></tr>
</table>
</div>
<div id="step3"></div>